package com.woniuxy.controller;

import com.woniuxy.entity.dto.BindManAndOrderDTO;
import com.woniuxy.entity.dto.DeliveryOrderQueryDTO;
import com.woniuxy.service.DeliveryOrderService;
import com.woniuxy.util.ResponseData;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: pigTrotterStore
 * @BelongsPackage: com.woniuxy.controller
 * @Author: Quan
 * @Date: 2025/3/18 19:57
 */
@RestController
@RequestMapping("/delivery")
@AllArgsConstructor
public class DeliveryOrderController {
	private  DeliveryOrderService orderService;

	/**
	 * @Description: 有条件的查询前端传来的数据，如果未传数据，则查询全部
	 * @Param: [orderQueryDTO]
	 * @return: com.woniuxy.util.ResponseData<?>
	 * @Author: Quan
	 * @Date: 2025/3/18
	 */
	@PostMapping("/queryDeliveryOrderInfo")
	public ResponseData<?> queryInfo(@RequestBody DeliveryOrderQueryDTO orderQueryDTO) {
		return orderService.queryInfo(orderQueryDTO);
	}

	@PostMapping("/bindManAndOrder")
	public ResponseData<?> bindManAndOrder(@RequestBody BindManAndOrderDTO dto) {
		return orderService.bindManAndOrder(dto);
	}
}
